#include "HookLibrary.h"

LPVOID WINAPI BGHeapAlloc(SIZE_T dwBytes)
{
	return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBytes);
}

LPWSTR WINAPI BGHeapAllocStr(SIZE_T cchString)
{
	return BGHeapAlloc(sizeof(WCHAR) * cchString);
}

BOOL WINAPI BGHeapFree(LPVOID lpMemory)
{
	return HeapFree(GetProcessHeap(), 0, lpMemory);
}

LPVOID WINAPI BGHeapRealloc(LPVOID lpMemory, SIZE_T dwBytes)
{
	if (lpMemory == NULL)
	{
		return BGHeapAlloc(dwBytes);
	}

	return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lpMemory, dwBytes);
}